/*
 * All content copyright http://www.j2eefast.com, unless
 * otherwise indicated. All rights reserved.
 * No deletion without permission
 */
package com.j2eefast.flowable.bpm.controller;

import com.j2eefast.common.core.business.annotaion.BussinessLog;
import com.j2eefast.common.core.controller.BaseController;
import com.j2eefast.common.core.enums.BusinessType;
import com.j2eefast.common.core.utils.PageUtil;
import com.j2eefast.common.core.utils.ResponseData;
import com.j2eefast.common.core.utils.ToolUtil;
import com.j2eefast.common.core.utils.ValidatorUtil;
import com.j2eefast.flowable.bpm.entity.BpmProcessDefinitionEntity;
import com.j2eefast.flowable.bpm.entity.BpmTaskFromEntity;
import com.j2eefast.flowable.bpm.service.BpmTaskFromService;
import com.j2eefast.flowable.bpm.service.ProcdefService;
import com.j2eefast.flowable.bpm.service.ProjectArchivesService;
import com.j2eefast.framework.annotation.RepeatSubmit;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.Map;

/**
 * <p>项目档案管理</p>
 *
 * @author: zhangyuan
 * @date: 2021-04-29 00:02
 * @web: http://www.letukeji.cn
 * @version: 1.0.1
 */
@Controller
@RequestMapping("/bpm/project")
public class ProjectController extends BaseController {

	private String urlPrefix = "modules/bpm/project";

	@Autowired
	private ProjectArchivesService projectArchivesService;

	@RequestMapping("/list")
	@RequiresPermissions("bpm:task:view")
	@ResponseBody
	public ResponseData list(@RequestParam Map<String, Object> params) {
		PageUtil page = projectArchivesService.findPage(params);
		return success(page);
	}

	@RequiresPermissions("bpm:project:view")
	@GetMapping()
	public String project() {
		return urlPrefix + "/project";
	}

	@GetMapping("/preview/{id}")
	@RequiresPermissions("bpm:project:list")
	public String preview(@PathVariable("id") String id, ModelMap mmap) {
		mmap.put("id",id);
		return  urlPrefix + "/view";
	}


}
